home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 September / CHIP Eylül 1998.iso / Slackwar / docs / Cyrillic-HOWTO < prev    next >
Text File  |  1997-01-29  |  73KB  |  1,718 lines

  1.   The Linux Cyrillic HOWTO
  2.   Alexander L. Belikoff, (abel@bfr.co.il), Berger Financial Research
  3.   Ltd.
  4.   v4.0, 23 January 1998
  5.  
  6.   This document describes how to set up your Linux box to typeset, view
  7.   and print the documents in the Russian language.
  8.  
  9.   1.  Administrativia
  10.  
  11.   1.1.  Introduction
  12.  
  13.   This document covers the things you need to successfully work with
  14.   information containing cyrillic text (mostly Russian) under Linux.
  15.   Although this document assumes your using Linux as an operating
  16.   system, most of information presented is equally applicable to many
  17.   other Unix flavors. I shall try to keep the distinction as visible as
  18.   possible.
  19.  
  20.   There are a number of popular Linux distributions. As an example
  21.   system I describe the RedHat 4.1 Linux (Vanderbildt) - the one I am
  22.   personally using. Nevertheless, I shall try to highlight the
  23.   differences, if they exist, in other popular distributions, such as
  24.   Debian GNU/Linux and Slackware Linux.
  25.  
  26.   Since such setup directly modifies and extends the Operating System,
  27.   you should understand, what you are doing. Even though I tried to keep
  28.   things as easy as possible, having some experience with a given piece
  29.   of software is an advantage. I am not going to describe what the X
  30.   Window System is or how to typeset the documents with TeX and LaTeX,
  31.   or how to install printer in Linux. Those issues are covered in other
  32.   documents.
  33.  
  34.   For the same reason, in most cases I describe a system-wide setup, by
  35.   default requiring root privileges. Still, if there is a possibility
  36.   for user-level setup, I'll try to mention it.
  37.  
  38.   NOTE: The X Window System, TeX and other Linux components are complex
  39.   systems with a sofisticated configuration. If you do something wrong,
  40.   you can not only fail with Russian setup, but to break the component
  41.   as well, if not the entire system. This is not to scare you off, but
  42.   merely to make you understand the seriousness of the process and be
  43.   careful. Preliminary backup of the config files is highly recommended.
  44.   Having a guru around is also advantageous.
  45.  
  46.   1.2.  Availability and feedback
  47.  
  48.   This document is available at sunsite.unc.edu or tsx-11.mit.edu as a
  49.   part of the Linux Document Project. Also, it may be available at
  50.   various FTP sites containing Linux. Moreover, it may be included as a
  51.   part of Linux distribution.
  52.  
  53.   If you have any suggestions or corrections regarding this document,
  54.   please, don't hesitate to contact me as abel@bfr.co.il. Any new and
  55.   useful information about Cyrillic support in various Unices is highly
  56.   appreciated. Remember, it will help the others.
  57.  
  58.   1.3.  Acknowledgments and copyrights
  59.  
  60.   Many people helped me (and not only me) with valuable information and
  61.   suggestions. Even more people contributed software to the public
  62.   community. I am sorry if I forgot to mention somebody.
  63.  
  64.   So, here they go:
  65.  
  66.   ╖  Bas V. de Bakker
  67.  
  68.   ╖  David Daves
  69.  
  70.   ╖  Serge Vakulenko
  71.  
  72.   ╖  Sergei O. Naoumov
  73.  
  74.   ╖  Winfried Truemper
  75.  
  76.   ╖  Ilya K. Orehov
  77.  
  78.   ╖  Michael Van Canneyt
  79.  
  80.   ╖  Alex Bogdanov
  81.  
  82.   ╖  relcom.fido.ru.unix and relcom.fido.ru.linux Usenet newsgroups.
  83.  
  84.   This document is Copyright (C) 1995,1997 by Alexander L. Belikoff. It
  85.   may be used and distributed under the usual Linux HOWTO terms
  86.   described below.
  87.  
  88.   The following is a Linux HOWTO copyright notice:
  89.  
  90.        Unless otherwise stated, Linux HOWTO documents are copy¡
  91.        righted by their respective authors. Linux HOWTO documents
  92.        may be reproduced and distributed in whole or in part, in
  93.        any medium physical or electronic, as long as this copyright
  94.        notice is retained on all copies. Commercial redistribution
  95.        is allowed and encouraged; however, the author would like to
  96.        be notified of any such distributions.
  97.  
  98.        All translations, derivative works, or aggregate works
  99.        incorporating any Linux HOWTO documents must be covered
  100.        under this copyright notice.  That is, you may not produce a
  101.        derivative work from a HOWTO and impose additional restric¡
  102.        tions on its distribution. Exceptions to these rules may be
  103.        granted under certain conditions; please contact the Linux
  104.        HOWTO coordinator at the address given below.
  105.  
  106.        In short, we wish to promote dissemination of this informa¡
  107.        tion through as many channels as possible. However, we do
  108.        wish to retain copyright on the HOWTO documents, and would
  109.        like to be notified of any plans to redistribute the HOWTOs.
  110.  
  111.   If you have questions, please contact Greg Hankins, the Linux HOWTO
  112.   coordinator, at gregh@sunsite.unc.edu. You may finger this address for
  113.   phone number and additional contact information.
  114.  
  115.   Unix is a technology trademark of the X/Open Ltd.; MS-DOS, Windows,
  116.   Windows 95, and Windows NT are trademarks of the Microsoft Corp.; The
  117.   X Window System is a trademark of The X Consortium Inc. Other
  118.   trademarks belong to the appropriate holders.
  119.  
  120.   2.  Theoretical background
  121.  
  122.   2.1.  Characters and codesets
  123.  
  124.   In order to understand and print characters of various languages, the
  125.   system and software should be able to distinguish them from other
  126.   characters. That is, each unique character must have a unique
  127.   representation inside the operating system, or the particular software
  128.   package. Such collection of all unique characters, that the system is
  129.   able to represent at once, is called a codeset.
  130.  
  131.   At the time of the most operating system's creation, nobody cared
  132.   about software being multilingual. Therefore, the most popular codeset
  133.   was (and actually is) an ASCII (American Standard Code for Information
  134.   Interchange).
  135.  
  136.   The standard ASCII (aka 7-bit ASCII) comprises 128 unique codes. Some
  137.   of them ASCII defines as real printable characters, and some are so-
  138.   called control characters, which had special meanings in the old
  139.   communication protocols. Each element of the set is identified by an
  140.   integer character code (0-127). The subset of printable characters
  141.   represents those found on the typewriter's keyboard with some minor
  142.   additions. Each character occupies 7 least significant bits of a byte,
  143.   whereas the most significant one was used for control purposes (say,
  144.   transmission control in old communication packages).
  145.  
  146.   The 7-bit ASCII concept was extended by 8-bit ASCII (aka extended
  147.   ASCII). In this codeset, the characters' codes' range is 0-255. The
  148.   lower half (0-127) is pure ASCII, whereas the upper one contains 127
  149.   more characters. Since this codeset is backward compatible with the
  150.   ASCII (character still occupies 8 bit, the codes correspond the old
  151.   ASCII), this codeset gained wide popularity.
  152.  
  153.   The 8-bit ASCII doesn't define the contents of the upper half of the
  154.   codeset. Therefore the ISO organization took the responsibility of
  155.   defining a family of standards known as ISO 8859-X family. It is a
  156.   collection of 8-bit codesets, where the lower half of each codeset
  157.   (characters with codes 0-127) matches the ASCII and the upper parts
  158.   define characters for various languages. For example, the following
  159.   codesets are defined:
  160.  
  161.   ╖  8859-1 - Europe, Latin America (also known as Latin 1)
  162.  
  163.   ╖  8859-2 - Eastern Europe
  164.  
  165.   ╖  8859-5 - Cyrillic
  166.  
  167.   ╖  8859-8 - Hebrew
  168.  
  169.   In Latin 1, the upper half of the table defines various characters
  170.   which are not part of the English alphabet, but are present in various
  171.   european languages (german umlauts, french accentes etc).
  172.  
  173.   Another popular extended ASCII implementation is so-called IBM
  174.   codepage (named after some computer company, that developed this
  175.   codeset for it's infamous personal computers). This one contains
  176.   pseudo-graphic characters in the upper half.
  177.  
  178.   Software, that doesn't make any assumptions about the 8-th bit of the
  179.   ASCII data is called 8-bit clean. Some older programs, designed with
  180.   7-bit ASCII in mind are not 8-bit clean and may work incorrectly with
  181.   your extended ASCII data. Most of packages, however, are able to deal
  182.   with the extended ASCII by default, or require some very basic setup.
  183.   NOTE: before posting the question "I did all setup right, but I cannot
  184.   enter/view Cyrillic characters!", please consult the section ``'' for
  185.   the notes on the program, you are using.
  186.  
  187.   For information about making your software 8-bit clean, see section
  188.   ``''.
  189.  
  190.   Since on most systems character occupies 8 bits, there is no way to
  191.   extend ASCII more and more. The way to implement new symbols in ASCII-
  192.   based codesets is creation of other extended ASCII implementations.
  193.   This is the way, the Cyrillic ASCII set is implemented.
  194.  
  195.   We already mentioned ISO 8859-5 standard as the one defining the
  196.   Cyrillic codeset. But as it often happens to the standards, this one
  197.   was developed without taking into account the real practices in the
  198.   former USSR. Therefore, one thing that standard really achieved was
  199.   another degree of confusion. I wouldn't say that ISO 8859-5 is widely
  200.   used anywhere.
  201.  
  202.   Other standards for Cyrillic include the so-called Alt codeset and
  203.   Microsoft CP1251 codepage. The former one was developed by (who?) for
  204.   MS-DOS quite a while ago. Back then, there was not very buzz yet about
  205.   internetworking, so the intention was to make it as compatible as
  206.   possible with the IBM standard. Therefore the Alt codeset is
  207.   effectively the same IBM codepage, where all specific European
  208.   characters in the upper half were replaced with the Cyrillic ones,
  209.   leaving the pseudographic ones. Therefore, it didn't screw the text
  210.   windowing facilities and provided Cyrillic characters as well.  The
  211.   Alt standard is still alive and extremely popular in MS-DOS.
  212.  
  213.   Microsoft CP1251 codepage is just an attempt of Microsoft to come up
  214.   with the new standard for Cyrillic codeset in Windows. As far as I
  215.   know, it is not compatible with anything else (not very surprizing,
  216.   huh?)
  217.  
  218.   And finally there is KOI8-R. This one is also quite old, but it was
  219.   designed wisely and nowadays the design points of it look really
  220.   useful.
  221.  
  222.   Again, it is compatible with ASCII, and the Cyrillic characters are
  223.   located in the upper half. But the main design point of KOI8-R is that
  224.   the Cyrillic characters' positions must correspond to the English
  225.   characters with the same phonetics. Namely, if we set the eighth bit
  226.   of the English character 'a', we'll get the Cyrillic 'a'.  This means
  227.   that, given the Cyrillic text written in KOI8-R, we can strip the
  228.   eighth bit of each character and we still get a readable text,
  229.   although written with English characters! This is very important now,
  230.   since there are many mailers on the Internet, that just strip the
  231.   eighth bit silently, being sure that every single soul on the face of
  232.   the Earth speaks English.
  233.  
  234.   Not surprisingly, KOI8-R quickly became a de-facto standard for
  235.   Cyrillic on the Internet. Andrew A. Chernov did a tremendous amount of
  236.   work to make a standard in this area. He is an author of RFC 1489
  237.   ("Registration of a Cyrillic Character Set").
  238.  
  239.   These two standards differ only in positions of the cyrillic
  240.   characters in the table (that is in cyrillic character codes).
  241.   The principal difference is that the Alt codeset is used by MS-DOS
  242.   users only, whereas KOI8-R is used in Unix, as well as in MS-DOS
  243.   (though in the latter KOI8-R is much less popular). Since we are doing
  244.   the right thing (namely working in the Unix operating system), we
  245.   shall focuse mostly on KOI8-R.
  246.  
  247.   As for the ISO standard, it is more popular in Europe and the US as a
  248.   standard for Cyrillic. The leader in Russia is definitely KOI8-R.
  249.  
  250.   There are other standards, which are different from ASCII and much
  251.   more flexible. Unicode is most known. However, they are not
  252.   implemented as good as the basic ones in Unix in general and  Linux in
  253.   particular. Therefore, I am not describing them here.
  254.  
  255.   3.  Preparing your environment
  256.  
  257.   Before we start customizing various parts of the system functionality,
  258.   we have to set up a couple basic things. Most of tools described below
  259.   assume that there are Cyrillic fonts available and a user is able to
  260.   input Cyrillic characters. To make it true we have to configure the
  261.   environment to provide both fonts and input facility for Cyrillic.
  262.  
  263.   There are effectively two interface models supported by Linux. One is
  264.   the text mode, and the other one is the graphic mode, provided by the
  265.   X Window System. Both require different setup, which will be described
  266.   below.
  267.  
  268.   3.1.  Text mode setup
  269.  
  270.   Generally, the text mode setup is the easiest way to show and input
  271.   Cyrillic characters. There is one significant complication, however:
  272.   the text mode fonts and keyboard layout manipulations depend on
  273.   terminal driver implementation. Therefore, there is no portable way to
  274.   achieve the goal across different systems.
  275.  
  276.   Right now, I describe the way to deal with the Linux console driver.
  277.   Thus, if you have another system, don't expect it to work for you.
  278.   Instead, consult your terminal driver manual. Nevertheless, send me
  279.   any information you find, so I'll be able to include it in further
  280.   versions of this document.
  281.  
  282.   3.1.1.  Linux Console
  283.  
  284.   The Linux console driver is quite a flexible piece of software. It is
  285.   capable of changing fonts as well as keyboard layouts. To achieve it,
  286.   you'll need the kbd package. Both RedHat and Slackware install kbd as
  287.   part of a system.
  288.  
  289.   The kbd package contains keyboard control utilities as well as a big
  290.   collection of fonts and keyboard layouts.
  291.  
  292.   Cyrillic setup with kbd usually involves two things:
  293.  
  294.   1. Screen font setup. This is performed by the setfont program. The
  295.      fonts files are located in /usr/lib/kbd/consolefonts.
  296.  
  297.      NOTE: Never run the setfont program under X because it will hang
  298.      your system. This is because it works with low-level video card
  299.      calls which X doesn't like.
  300.  
  301.   2. Load the appropriate keyboard layout with the loadkeys program.
  302.  
  303.   NOTE: In RedHat 3.0.3, /usr/bin/loadkeys has too restrictive access
  304.   permissions, namely 700 (rwx------). There are no reasons for that,
  305.   since everyone may compile his own copy and execute it (the
  306.   appropriate system calls are not root-only). Thus, just ask your
  307.   sysadmin to set more reasonable permissions for it (for example, 755).
  308.  
  309.   The following is an excerpt from my cyrload script, which sets up the
  310.   Cyrillic mode for Linux console:
  311.  
  312.   if [ notset.$DISPLAY != notset. ]; then
  313.       echo "`basename $0`:  cannot run under X"
  314.       exit
  315.   fi
  316.  
  317.   loadkeys /usr/lib/kbd/keytables/ru.map
  318.   setfont /usr/lib/kbd/consolefonts/Cyr_a8x16
  319.   mapscrn /usr/lib/kbd/consoletrans/koi2alt
  320.   echo -ne "\033(K"              # the magic sequence
  321.   echo "Use the right Ctrl key to switch the mode..."
  322.  
  323.   Let me explain it a bit. You load the appropriate keyboard mapping.
  324.   Then you load a font corresponding to the Alt codeset. Then, in order
  325.   to be able to display text in KOI8-R correctly, you load a screen
  326.   translation table. What it does is a translation of some characters
  327.   from the upper half of the codeset to the Alt encoding. The word
  328.   'some' is crucial here - not all characters get translated, therefore
  329.   some of them, like IBM pseudographic characters get unmodified to the
  330.   screen and display correctly, since they are compatible with the Alt
  331.   codeset, as opposed to KOI8-R. To ensure this, run mc and pretend you
  332.   are back to MS-DOS 3.3...
  333.  
  334.   Finally, the magic sequence is important but I have no idea what on
  335.   the Earth it does. I stole/borrowed/learned it from German HOWTO back
  336.   in 1994, when it was like the only national language oriented HOWTO.
  337.   If you have any idea about this magic sequence, please tell me.
  338.  
  339.   Finally, for those purists, who don't wont to give the Alt codeset a
  340.   chance, I'm attaching yet another version of the script above, using
  341.   native KOI8-R fonts.
  342.  
  343.   if [ notset.$DISPLAY != notset. ]; then
  344.       echo "`basename $0`:  cannot run under X"
  345.       exit
  346.   fi
  347.  
  348.   loadkeys /usr/lib/kbd/keytables/ru.map
  349.   setfont /usr/lib/kbd/consolefonts/koi-8x16
  350.   echo "Use the right Ctrl key to switch the mode..."
  351.  
  352.   However, don't expect nice borders in your text mode-based windowing
  353.   applications.
  354.  
  355.   Now you probably want to test it. Do the appropriate bash or tcsh
  356.   setup, rerun it, then press the right Control key and make sure you
  357.   are getting the cyrillic characters right. The 'q' key must produce
  358.   russian "short i" character, 'w' generates "ts", etc.
  359.  
  360.   If you've screwed something up, the very best thing to do is to reset
  361.   to the original (that is, US) settings. Execute the following
  362.   commands:
  363.  
  364.   loadkeys /usr/lib/kbd/keytables/defkeymap.map
  365.   setfont /usr/lib/kbd/consolefonts/default8x16
  366.  
  367.   NOTE: unfortunately enough, the console driver is not able to preserve
  368.   it's state (at least easily enough), while running the X Window
  369.   System. Therefore, after you leave the X (or switch from it to a
  370.   console), you have to reload the console russian font.
  371.  
  372.   3.1.2.  FreeBSD Console
  373.  
  374.   I am not using FreeBSD so I couldn't test the following information.
  375.   All data in this section should be treated as just pointers to begin
  376.   with. The FreeBSD project homepage may have some information on the
  377.   subject. Another good source is the relcom.fido.ru.unix newsgroup.
  378.   Also, check the resources listed in section ``''.
  379.  
  380.   Anyway, this is what Ilya K. Orehov suggests to do in order to make
  381.   FreeBSD console speak Russian:
  382.  
  383.   1. In /etc/sysconfig add:
  384.  
  385.      keymap=ru.koi8-r
  386.      keyrate=fast
  387.      # NOTE: '^[' below is a single control character
  388.      keychange="61 ^[[K"
  389.      cursor=destructive
  390.      scrnmap=koi8-r2cp866
  391.      font8x16=cp866b-8x16
  392.      font8x14=cp866-8x14
  393.      font8x8=cp866-8x8
  394.  
  395.   2. In /etc/csh.login:
  396.  
  397.      setenv ENABLE_STARTUP_LOCALE
  398.      setenv LANG ru_SU.KOI8-R
  399.      setenv LESSCHARSET latin1
  400.  
  401.   3. Make analogous changes in /etc/profile
  402.  
  403.   3.2.  The X Window System
  404.  
  405.   Like the console mode, the X environment also requires some setup.
  406.   This involves setting up the input mode and the X fonts. Both are
  407.   being discussed below.
  408.  
  409.   3.2.1.  The X fonts.
  410.  
  411.   First of all, you have to obtain the fonts having the Cyrillic glyphs
  412.   at the appropriate positions.
  413.  
  414.   If you are using the most recent X (or XFree86) distribution, chances
  415.   are, that you already have such fonts. In the late 1995, the X Window
  416.   System incorporated a set of Cyrillic fonts, created by Cronyx. Ask
  417.   your system administrator, or, if you are the one, check your system,
  418.   namely:
  419.  
  420.   1. Run 'xlsfonts | grep koi8'. If there are fonts listed, your X
  421.      server is already aware about the fonts.
  422.  
  423.   2. Otherwise, run
  424.  
  425.      find -name crox\*.pcf\*
  426.  
  427.   to find the location of the Cyrillic fonts in the system. You'll have
  428.   to enable those fonts to the X server, as I explain below.
  429.  
  430.   If you haven't found such fonts installed, you'll have to do it
  431.   yourself.
  432.  
  433.   There is some ambiguity with the fonts. XFree86 docs claim that the
  434.   russian fonts collection included in the distribution is developed by
  435.   Cronyx. Nevertheless, you may find another set of Cronyx Cyrillic
  436.   fonts on the net (eg. on ftp.kiae.su), known as the xrus package
  437.   (don't confuse it with the xrus program, which is used to setup a
  438.   Cyrillic keyboard layout. Hopefully, tha letter one was renamed to
  439.   xruskb recently). Xrus has fewer fonts than the collection in Xfree86
  440.   (38 vs 68), but the latter one didn't go along with my ``Netscape''
  441.   setup - it gave me some really huge font in the menubar. The xrus
  442.   package doesn't have this problem.
  443.  
  444.   I would suggest you to download and try both of them. Pick up the one
  445.   which you'll like more. Also, I'm going to creat RPM packages soon for
  446.   both collections and download them to ftp.redhat.com.
  447.  
  448.   There are also older stuff, for example the vakufonts package, created
  449.   by Serge Vakulenko, which was the base for the one in the X
  450.   distribution. There are also a number of others. The important point
  451.   is that the fonts' names in the old collection were not strictly
  452.   conforming to the standard. The latter is fine in general, but
  453.   sometimes it may cause various weird errors. For example, I had a bad
  454.   experience with Maple V for Linux, which crashed mysteriously with the
  455.   vakufonts package, but ran smoothly with the "standard" ones.
  456.  
  457.   So, let's start with the fonts:
  458.  
  459.   1. Download the appropriate fonts collection. The package for XFree86
  460.      may be found at any FTP site, containing the X distribution, for
  461.      example, directly from the XFree86 FTP site. The xrus package may
  462.      be found on ftp.kiae.su
  463.   2. Now when you have the fonts, you create some directory for them. It
  464.      is generally a bad idea to put new fonts to the already existing
  465.      font directory. So, place them, to, say,
  466.      /usr/lib/X11/fonts/cyrillic for a system-wide setup, or just create
  467.      a private directory for personal use.
  468.  
  469.   3. If the new fonts are in BDF format (*.bdf files), you have to
  470.      compile them. For each font do:
  471.  
  472.      bdftopcf -o <font>.pcf <font>.bdf
  473.  
  474.   If your server supports compressed fonts, do it, using the compress
  475.   program:
  476.  
  477.   compress *.pcf
  478.  
  479.   Also, if you do want to put the new fonts to an already existing font
  480.   directory. you have to concatenate the old and the new files named
  481.   fonts.alias in the case both of them exist.
  482.  
  483.   4. Each font directory in the X must contain a list of fonts in it.
  484.      This list is stored in the file fonts.dir. You don't have to create
  485.      this list manually. Instead, do:
  486.  
  487.      cd <new font directory>
  488.      mkfontdir .
  489.  
  490.   5. Now you have to make this font directory known to the X server.
  491.      Here, you have a number of options:
  492.  
  493.   ╖  System-wide setup for XFree86. If you are running this version of
  494.      X, then append the new directory to the list of directories in the
  495.      file XF86Config. To find the location of this file, see output of
  496.      startx. Also, see XF86Config(4/5) for details.
  497.  
  498.   ╖  System-wide setup through xinit. Add the new directory to the xinit
  499.      startup file. See xinit(1x) and the next option for details.
  500.  
  501.   ╖  Personal setup. You have a special start-up file for the X -
  502.      ~/.xinitrc (or ~/.Xclients, or ~/.xsession for the RedHat users).
  503.      Add the following commands to it:
  504.  
  505.      xset +fp <new font directory>
  506.      xset fp rehash
  507.  
  508.   It is important to note that '+fp' means that the new fonts will be
  509.   added to the head of the font path list. That is, if an application
  510.   requests say a fixed font, it'll be given the one with Cyrillic char¡
  511.   acters, which is definitely what we are trying to achieve.
  512.  
  513.   There are problems, though. The fixed font in the cyrillic fonts dis¡
  514.   tribution doesn't have it's bold and italic counterparts. My font of
  515.   choice is 6x13, so, since it also lacks bold and italic typefaces, I
  516.   cannot use Emacs/XEmacs faces in their full glory. Hopefully somebody
  517.   will ultimately create those fonts and the situation will change.
  518.  
  519.   6. Now restart your X. If you have done everything right, the tests in
  520.      the beginning of the section will be successful. Also, play with
  521.      xfontsel(1x) to make sure you are able to select the cyrillic
  522.      fonts.
  523.  
  524.   In order to make the X clients use the Cyrillic fonts, you have to set
  525.   up the appropriate X resources. For example, I make the russian font
  526.   the default one in my ~/.Xdefaults:
  527.  
  528.   *font:         6x13
  529.  
  530.   Since my cyrillic fonts are first in the font path (see output of
  531.  
  532.   This just a simple case. If you want to set the appropriate part of
  533.   the X client to a cyrillic font, you have to figure out the name of
  534.   the resource (eg. using editres(1x)) and to specify it either in the
  535.   resource database, or in the command line. Here go some examples:
  536.  
  537.   $ xterm -font '-cronyx-*-bold-*-*-*-19-*-*-*-*-*-*-*'
  538.  
  539.   $ xfontsel -xrm '*quitButton.font: -*-times-*-*-*-*-13-*-*-*-*-*-koi8-*'
  540.  
  541.   xfontsel.
  542.  
  543.   3.2.2.  The input translation
  544.  
  545.   In the newest X releases (X11R61 and higher) there are two "standard"
  546.   input methods: the original one, working through the xmodmap utility,
  547.   and the new one called Xkb (X KeyBoard). The very first thing you have
  548.   to do is to disable the Xkb method! Don't get charmed by it's ability
  549.   to set up a "russian keyboard". It looks like this method is using the
  550.   Cyrillic keysyms defined in keysymdef.h. This file defines keysyms for
  551.   many languages. The only problem is that those definitions have
  552.   nothing to do with the extended ASCII codeset - the one most programs
  553.   are only able to operate with! I hardly know any programs being able
  554.   to grok the keysymdef.h keysyms, different from 8-bit ASCII. However
  555.   our goal is to get the KOI8-R support to work.
  556.  
  557.   To disable the Xkb support, browse through the Keyboard section of
  558.   your XF86Config file and comment all lines starting with Xkb (case
  559.   doesn't matter). Instead, put the following line:
  560.  
  561.   XkbDisable
  562.  
  563.   The xmodmap program.allows customization of codes emitted by various
  564.   characters and their combinations. It sets the things up based on the
  565.   file containing the translation table.
  566.  
  567.   In the previous versions of this document I used to describe the
  568.   xmodmap-based setup in a great detail. This proved to be almost
  569.   useless. The Xmodmap-based input translation method is well known as
  570.   being it is non-portable, inflexible, and incomplete.  Your
  571.   configuration may work with one XFree version and fail with a
  572.   different one. Even worse, sometimes things differ accross different
  573.   servers in the same distribution.
  574.  
  575.   I strongly suggest you not to play with this xmodmap, at least for
  576.   now. Apart from headache and disappointment you'll gain nothing.
  577.   Instead, I recommend installing the xruskb package, which allows you
  578.   to configure most of the input translation parameters without having
  579.   to know about xmodmap. Again, the RedHat Linux users are free to
  580.   download and install an RPM package.
  581.  
  582.   3.3.  First steps - Cyrillic in shells
  583.  
  584.   3.4.  bash
  585.  
  586.   Three variables should be set on order to make bash understand the
  587.   8-bit characters. The best place is ~/.inputrc file. The following
  588.   should be set:
  589.  
  590.   set meta-flag on
  591.   set convert-meta off
  592.   set output-meta on
  593.  
  594.   3.5.  csh/tcsh
  595.  
  596.   The following should be set in .cshrc:
  597.  
  598.   setenv LC_CTYPE iso_8859_5
  599.   stty pass8
  600.  
  601.   If you don't have the POSIX stty (impossible for Linux), then replace
  602.   the last call to the following:
  603.  
  604.   stty -istrip cs8
  605.  
  606.   3.6.  ksh
  607.  
  608.   As for the public domain ksh implementation - pdksh 5.1.3, you can
  609.   input 8 bit characters only in vi input mode. Use:
  610.  
  611.   set -o vi
  612.  
  613.   3.7.  less
  614.  
  615.   So far, less doesn't support the KOI8-R character set, but the
  616.   following environment variable will do the job:
  617.  
  618.   LESSCHARSET=latin1
  619.  
  620.   3.8.  mc (The Midnight Commander)
  621.  
  622.   To display Cyrillic text correctly, select the full 8 bits item in the
  623.   Options/Display menu.
  624.  
  625.   If your problem is the ugly windows' borders, consult the ``''
  626.   section.
  627.  
  628.   As an off-topic, if you want to make mc use color in an Xterm window,
  629.   set the variable COLORTERM:
  630.  
  631.   COLORTERM= ; export COLORTERM
  632.  
  633.   3.9.  rlogin
  634.  
  635.   Make sure that the shell on the destination site is properly set up.
  636.   Then, if your rlogin doesn't work by default, use 'rlogin -8'.
  637.  
  638.   3.10.  zsh
  639.  
  640.   Use the same way as with csh (see section ``csh''). The startup files
  641.   in this case are .zshrc or /etc/zshrc.
  642.  
  643.   4.  Editing text
  644.  
  645.   In this section I'll describe how to customize various text editors to
  646.   work with Cyrillic text. This doesn't cover the word processors, which
  647.   will be described later (see section ``'').
  648.  
  649.   4.1.  Emacs and XEmacs
  650.  
  651.   There are two version of the Emacs editor - GNU Emacs and XEmacs.
  652.   While they provide more or less same functionality, some
  653.   implementation details are significantly different. Cyrillic setup
  654.   requires some low-level (in Emacs Lisp sense) tweaking, and it differs
  655.   a bit for those two versions.
  656.  
  657.   NOTE: Apart from the setup described here, there is an alternative way
  658.   to configure both versions of emacs - use MULE (MULtilanguage Emacs
  659.   support). The latter way is fairly complicated and (to the best of my
  660.   knowledge) rarely used, so I don't discuss it here.
  661.  
  662.   The minimal cyrillic support in GNU emacs (you don't have to do it for
  663.   the XEmacs) is done by adding the following calls to one's installed
  664.   for console or X respectively):
  665.  
  666.   (standard-display-european t)
  667.  
  668.   (set-input-mode (car (current-input-mode))
  669.      (nth 1 (current-input-mode))
  670.      0)
  671.  
  672.   This allows the user to view and input documents in Russian.
  673.  
  674.   However, it isn't enough. Emacs doesn't know yet, that Cyrililic
  675.   characters may constitute a word, let alon the upper/lower case
  676.   conversion rules. In order to teach Emacs doing that, you have to
  677.   modify the syntax and case tables of emacs:
  678.  
  679.   (require 'case-table)
  680.  
  681.   (let* ((ruc "\341\342\367\347\344\345\263\366\372\351\352\353\354\355\356\357\360\362\363\364\365\346\350\343\376\373\375\370\371\377\374\340\361")
  682.          (rlc "\301\302\327\307\304\305\243\326\332\311\312\313\314\315\316\317\320\322\323\324\325\306\310\303\336\333\335\330\331\337\334\300\321")
  683.          (i 0)
  684.          (len (length ruc)))
  685.     (while (< i len)
  686.       (modify-syntax-entry (elt ruc i) "w  ")
  687.       (modify-syntax-entry (elt rlc i) "w  ")
  688.       (set-case-syntax-pair (elt ruc i) (elt rlc i) (standard-case-table))
  689.       (setq i (+ i 1))))
  690.  
  691.   For this purpose I created a rusup.el file which does this, as well as
  692.   a couple handy functions. You have to load it in your ~/.emacs.
  693.  
  694.   Finally, the russian.el <http://www.math.uga.edu/~valery/russian.el>
  695.   package by Valery Alexeev (valery@math.uga.edu) allows the user to
  696.   switch between cyrillic and regular input mode and to translate the
  697.   contents of a buffer from one Cyrillic coding standard to another
  698.   (which is especially useful while reading the texts imported from MS-
  699.   DOS or Windows).
  700.  
  701.   4.2.  Using vi
  702.  
  703.   The vi editor (at least it's clone vim, available in most Linux
  704.   distributions) is aware of 8-bit characters. It will allow you to
  705.   enter cyrillic characters and will be able to recognize the word
  706.   boundaries correctly. I don't know about the upper-/lower-case
  707.   conversion rules, since I don't use vi much. If you know something
  708.   about it, please inform me.
  709.  
  710.   4.3.  Editing text with joe
  711.  
  712.   Joe requires a special -asis option to recognize 8-bit characters. You
  713.   may either specify this option at the command line, or to put it in
  714.   ~/.joerc file (for personal use, or in /usr/lib/joerc for system-wide
  715.   setup.
  716.  
  717.   If your program doesn't understand -asis option, you have to upgrade
  718.   to the newer version.
  719.  
  720.   However, joe doesn't seem to understand the cyrillic words' boundaries
  721.   correctly. I assume, that it applies both to the case conversion
  722.   rules.
  723.  
  724.   4.4.  Spell-checking Russian
  725.  
  726.   The program I use to spell-check text is the GNU ispell. It is very
  727.   flexible and extensible, so it is possible to use it to spell-check
  728.   text in languages, other than English, by adding new spell
  729.   dictionaries.
  730.  
  731.   Constantine Knizhnik has created a very good Russian dictionary for
  732.   ispell. You may find it at his homepage. The distribution includes a
  733.   handy incremental spelling script for emacs.
  734.  
  735.   Ideally, if you already have an ispell properly installed, you have to
  736.   just step into the newly-created directory and generate the
  737.   dictionary, using the commands provided in the Makefile. However,
  738.   chances are quite high, that you'll see a lot of complaints about the
  739.   ispell's unawareness of the 8-bit data. This is because in most
  740.   distributions, ispell is compiled without 8-bit data support. In this
  741.   case, you cannot avoid recompiling the ispell package.
  742.  
  743.   Again, RedHat users will be delighted to know that I've rebuilt the
  744.   ispell package with both Russian and German dictionaries. As usual,
  745.   you may grab it from the RedHat FTP site.
  746.  
  747.   Once you have everything installed, you may invoke Russian spell-
  748.   check, by supplying '-d russian' option to ispell.
  749.  
  750.   Now, if you use Emacs, you may want to add a menu item for a russian
  751.   dictionary. I sent a proposed menu entry to the ispell.el maintainer
  752.   and he kindly agreed to include it in the the next public release of
  753.   the file. Meanwhile, you may do it by adding the following code in
  754.   your ~/.emacs (or in /usr/share/emacs/site-lisp/site-start.el for a
  755.   system-wide setup):
  756.  
  757.   (setq ispell-dictionary-alist
  758.     (append ispell-dictionary-alist
  759.             '(("russian"
  760.                "[\341\342\367\347\344\345\263\366\372\351\352\353\354\355\356\357\360\362\363\364\365\346\350\343\376\373\375\370\371\377\374\340\361\301\302\327\307\304\305\243\326\332\311\312\313\314\315\316\317\320\322\323\324\325\306\310\303\336\333\335\330\331\337\334\300\321]"
  761.                "[^\341\342\367\347\344\345\263\366\372\351\352\353\354\355\356\357\360\362\363\364\365\346\350\343\376\373\375\370\371\377\374\340\361\301\302\327\307\304\305\243\326\332\311\312\313\314\315\316\317\320\322\323\324\325\306\310\303\336\333\335\330\331\337\334\300\321]"
  762.                "[']" t ("-C" "-d" "russian") "~latin1"))))
  763.  
  764.   (define-key-after ispell-menu-map [ispell-select-russian]
  765.     '("Select Russian (KOI-8)" . (lambda ()
  766.                                    (interactive)
  767.                                    (ispell-change-dictionary "russian")))
  768.     'british)
  769.  
  770.   Unfortunately, it won't work for the XEmacs. I'll try to solve this
  771.   problem later.
  772.  
  773.   5.  Using Cyrillic with mail and news
  774.  
  775.   Setting up your mail and news software to recognize Cyrillic text is
  776.   not very difficult, although you have to possess some knowledge of
  777.   principles, mail and news work by.
  778.  
  779.   Internet electronic mail software generally consists of two parts: MUA
  780.   (Mail User Agent) and MTA (Mail Transfer Agent). MUA is the program
  781.   you use to read, compose, and send mail. However, MUA doesn't transfer
  782.   mail messages by itself. Instead, it calls the MTA, which is
  783.   reponsible to send message using an appropriate protocol to the
  784.   appropriate direction. For example, your MUA may be Pine and MTA -
  785.   qmail.
  786.  
  787.   Until quite recently, both MTA and MUA weren't 8-bit clean by default.
  788.   Therefore, whenever you sent your message from say America to Russia,
  789.   you were never sure, that some intermediate MTA won't strip the 8th
  790.   bit from each character of your message. Therefore, a set of protocols
  791.   was developed, which allowed encoding various kinds of data using only
  792.   printable characters from 7-bit ASCII. This family of protocols is
  793.   called MIME (MultimedIa Mail Encoding).
  794.  
  795.   Since MIME is usually pre-configured to reasonable defaults, we won't
  796.   describe it here. We will talk more about MIME when we provide a
  797.   backward compatibility with other Cyrillic encodings (section ``'').
  798.  
  799.   Meanwhile, we start MUA setup, because it is usually up to an end-
  800.   user. Then, we will describe the basic priciples of the MTA
  801.   configuration for Cyrillic.
  802.  
  803.   5.1.  Setting up Mail User Agents
  804.  
  805.   5.1.1.  Emacs-based mail readers
  806.  
  807.   Basically, you don't need any special setup for Emacs-based readers,
  808.   geivedn, that you've already configured the emacs itself (see section
  809.   ``'').
  810.  
  811.   5.1.2.  pine
  812.  
  813.   Set the following directive in ~/.pinerc for personal configuration,
  814.   or in /usr/lib/pine.conf for a global one:
  815.  
  816.   character-set=ISO-8859-5
  817.  
  818.   5.2.  Configuring your MTA
  819.  
  820.   There are a number of MTAs available now. These include sendmail,
  821.   qmail, smail, exim, and others.
  822.  
  823.   5.2.1.  sendmail
  824.  
  825.   So far, sendmail is much more popular than other MTAs, because it's
  826.   long history and widespread use. Personally, I hate this program - it
  827.   is a perfect example of a completely moronic design and even it's
  828.   "improvements" with the passion of time show, that this approach is
  829.   not going to cease. Any system administrator shudders, when he hears
  830.   the ominous "sendmail.cf" name...
  831.  
  832.   As of now, sendmail doesn't strip the 8th bit anymore. However, it may
  833.   encode the 8-bit data using a special base64 encoding. Although most
  834.   MUAs are supposed to recognize it and decode it back to a regular
  835.   data, you may want to start with sending raw 8-bit text to make sure
  836.   everything works.
  837.  
  838.   As of version 8, sendmail handles 8-bit data correctly by default. If
  839.   it doesn't do it for you, check the EightBitMode option and option 7
  840.   given to mailers in your /etc/sendmail.cf. See "Sendmail. Operation
  841.   and Installation Guide" for details.
  842.  
  843.   5.2.2.  Other MTAs
  844.  
  845.   I don't know much about other MTAs. If you know something, which may
  846.   be important for Cyrillic setup, please inform me.
  847.  
  848.   6.  Browsing the Cyrillic Web
  849.  
  850.   Unlike e-mail and news, there is no definitive standard for Cyrillic
  851.   encoding for the Web. This is primarily because Microsoft offers Web
  852.   authoring tools, which only allow cp1251 codeset for Cyrillic,
  853.   completely ignoring the fact that any other standards may already
  854.   exist.
  855.  
  856.   The setup described here is very basic. It will allow you to view
  857.   pages in the KOI8-R codeset. If the situation improves, I'll add more
  858.   information.
  859.  
  860.   6.1.  lynx
  861.  
  862.   As of version 2.6, you may select the appropriate encoding for the
  863.   display Character set option.
  864.  
  865.   6.2.  Netscape navigator
  866.  
  867.   Make sure you are using Netscape version higher than 3. If your
  868.   Netscape is older, download a new one from www.netscape.com.
  869.  
  870.   6.2.1.  Basic setup
  871.  
  872.   To be able to see Cyrillic text in most parts of the HTML document, do
  873.   the following:
  874.  
  875.   ╖  In menu Options/Document Encoding select Cyrillic(KOI-8).
  876.  
  877.   ╖  In menu Options/General Preferences/Fonts select Cyrillic (KOI-8)
  878.      encoding, Times(Cronyx) as a proportional font and Courier(Cronyx)
  879.      as a fixed one.
  880.  
  881.   ╖  save options.
  882.  
  883.   NOTE: This setup will work with most parts of the document. However,
  884.   you won't be able to display Cyrillic text in the window header, menus
  885.   and some controls. Attempts to fix it follows.
  886.  
  887.   6.2.2.  Cyrillic text in frames and input areas
  888.  
  889.   To fix this, it is usually enough to:
  890.  
  891.   1. Copy the Netscape properties database (usually Netscape.ad) to
  892.      ~/Netscape.
  893.  
  894.   2. In the latter file, set the following property:
  895.  
  896.      *documentFonts.charset*iso8859-1:           koi8-r
  897.  
  898.   This will force all frame and input elements to use the fonts with
  899.   koi8-r encoding instead of the default ones, therefore you have to
  900.   make sure you have installed such fonts (see section ``'').
  901.  
  902.   The bad news about the trick above is that if you load a document
  903.   which is supposed to be displayed in iso-8859-1 fonts, it will be
  904.   displayed using the koi8 fonts instead. Sometimes such documents will
  905.   look worse.
  906.  
  907.   6.2.3.  Advanced setup
  908.  
  909.   Andrew A. Chernov is the one, who knows more than others about KOI-8
  910.   in general and netscape in particular. Visit his excellent KOI-8 page
  911.   and download a patch for Netscape resource file, making Netscape speak
  912.   Russian as much as it is able to.
  913.  
  914.   7.  Cyrillic wordprocessing
  915.  
  916.   7.1.  TeX-based environments
  917.  
  918.   In this section I'll describe several ways to make TeX and LaTeX
  919.   typeset Cyrillic texts. There are several ways, which differ in setup
  920.   sophistication and usage convenience. For example, one possibility is
  921.   to start without any preliminary setup and use the Washington AMSTeX
  922.   Cyrillic fonts. On the other hand, you may install a LaTeX package,
  923.   providing a very high degree of Cyrillic setup. I have an experience
  924.   with two such packages. One is the cmcyralt package by Vadim V.
  925.   Zhytnikov (vvzhy@phy.ncu.edu.tw) and Alexander Harin
  926.   (harin@lourie.und.ac.za), and the other one is the LH package by the
  927.   CyrTUG group with styles and hyphenation for LaTeX2e by Sergei O.
  928.   Naoumov (serge@astro.unc.edu). I'll describe both.
  929.  
  930.   Note, that there are two versions of LaTeX available - 2.09 is the old
  931.   one, while 2e is a new pre-3.0 release. If you are using LaTeX 2.09,
  932.   then switch quickly to the 2e. The latter retains compatibility with
  933.   the old one, but has much more features. Hopefully, version 3 will be
  934.   released soon. I describe a LaTeX 2e setup.
  935.  
  936.   Also, both of these packages require the Cyrillic text to be typeset
  937.   using the Alt codeset, not KOI8-R! This is caused by historical
  938.   reasons, since the creators of these packages used to work with EmTeX
  939.   - the MS-DOG version of TeX (they didn't know about Linux yet :-).
  940.   Switching to the KOI8-R requires some effort and is being expected to
  941.   be done soon. So far, use some utility to convert your russian text
  942.   from KOI8-R to Alt. See section ``''.
  943.  
  944.   7.1.1.  Using the Washington Cyrillic
  945.  
  946.   This package was created for the American Mathematic Society to
  947.   provide documents with Russian references. Therefore, the authors were
  948.   not very careful and the fonts look quite clumsy. This package is
  949.   usually referred to as a "really bad cyrillic package for TeX".
  950.  
  951.   Nevertheless, we'll discuss it, because it is very easy to use and
  952.   doesn't require any setup - this collection is supplied with most of
  953.   TeX distributions.
  954.  
  955.   Of course, you won't be able to use such luxury as automatic
  956.   hyphenation, but anyway...
  957.  
  958.   1. Prepend your document with the following directives:
  959.  
  960.   \input cyracc.def
  961.   \font\tencyr=wncyr10
  962.   \def\cyr{\tencyr\cyracc}
  963.  
  964.   2. Now to type a cyrillic letter, you enter
  965.  
  966.   \cyr
  967.  
  968.   and use a corresponding latin letter or a TeX command. Thus, the lower
  969.   case of the Russian alphabet is expressed by the following codes:
  970.  
  971.   a b v g d e \"e zh z i {\u i} k l m n o p r s t u f kh c ch sh shch
  972.   {\cprime} y {\cdprime} \`e yu ya
  973.  
  974.   It is extremely inconvenient to convert your Russian texts to such
  975.   encoding, but you can automate the process. The translit program
  976.   (section ``'') supports a TeX output option.
  977.  
  978.   7.1.2.  KOI-8 package for teTeX
  979.  
  980.   There is some new teTeX-rus package. It is reported to support KOI-8
  981.   character set and have all basic stuff required for TeX and LaTeX. I
  982.   personally haven't tried it yes, although I heard about it's
  983.   successfull usage.
  984.  
  985.   NOTE: This package requires you to reconfigure and rebuild some parts
  986.   of your teTeX package (for example the precompiled LaTeX macros).
  987.   Unless you know what you are doing, you shouldn't try it without
  988.   necessary care. Otherwise, you may be better off by borrowing the
  989.   precompiled parts fron somebody on the net
  990.  
  991.   7.1.3.  Using the cmcyralt package for LaTeX
  992.  
  993.   The cmcyralt package can be found on any CTAN (Comprehensive TeX
  994.   Archive Network) site like ftp.dante.de. You should obtain two pieces:
  995.   the fonts collection from fonts/cmcyralt and the styles and
  996.   hyphenation rules from macros/latex/contrib/others/cmcyralt.
  997.  
  998.   Note: Make sure you have the Sauter package installed, since cmcyralt
  999.   requires some fonts from it. You can get this package from CTAN site
  1000.   as well.
  1001.  
  1002.   Now you should do the following:
  1003.  
  1004.   1. Put the new fonts to the TeX fonts tree. On my system (Slackware
  1005.      2.2) I created a cmcyralt directory in the
  1006.      /usr/lib/texmf/fonts/cm/. Create the src, tfm, and vf
  1007.      subdirectories in it. Put there .mf, .tfm, and vf files
  1008.      respectively.
  1009.  
  1010.   2. Put the font driver files (*.fd) from the styles archive to the
  1011.      appropriate place (in my case it was /usr/lib/texmf/tex/latex/fd).
  1012.  
  1013.   3. Put the style files (*.sty) to the appropriate LaTeX styles
  1014.      directory (in my case /usr/lib/texmf/tex/latex/sty).
  1015.  
  1016.   Now the hyphenation setup. This requires to remake the LaTeX base
  1017.   file.
  1018.  
  1019.   1. The file hyphen.cfg contains the directives for both English and
  1020.      Russian hyphenation. Extract the one for Russian and place it to
  1021.      the LaTeX hyphenation config file lthyphen.ltx. In my case, that
  1022.      file was in /usr/lib/texmf/tex/latex/latex-base.
  1023.  
  1024.   2. Put the rhyphen.tex to the same directory. It is needed for making
  1025.      the new base file. Later, you can remove it.
  1026.  
  1027.   3. Do 'make' in that directory. Don't for get to make a link from
  1028.      Makefile to Makefile.unx. During the make process check the output.
  1029.      There should be a message:
  1030.  
  1031.      Loading hyphenation patterns for Russian.
  1032.  
  1033.   If everything goes OK, you will get the new latex.fmt in that direc¡
  1034.   tory. Put it to the appropriate place, where the previous one was
  1035.   (like /usr/lib/texmf/ini/). Don't forget to save the previous one!.
  1036.  
  1037.   This is it. The installation is complete. Try processing the examples
  1038.   found in the styles archive. If you are to create the PostScript files
  1039.   without any problems, then everything is OK. Now, to use Cyrillic in
  1040.   LaTeX, prepend your document with the following directive:
  1041.  
  1042.   \usepackage{cmcyralt}
  1043.  
  1044.   For more details, see the README file in the cmcyralt styles archive.
  1045.  
  1046.   Note: if you do have problems with the examples, provided you have
  1047.   installed the things right, then probably your TeX system hasn't been
  1048.   installed correctly. For example, during my first try, every attempt
  1049.   to create the .pk files for the russian fonts failed (MakeTeXPK
  1050.   stage). A substantial investigation discovered some implicit conflict
  1051.   between the localfont and ljfour METAFONT configurations. It used to
  1052.   work before, but kept crashing after the cmcyralt installation.
  1053.   Contact your local TeX guru - TeX is very (sometimes too much)
  1054.   complicated to reconfigure it without any prior knowledge.
  1055.  
  1056.   7.1.4.  Using the CyrTUG package
  1057.  
  1058.   You can obtain the CyrTUG package from the SunSite archive. Get the
  1059.   files CyrTUGfonts.tar.gz, CyrTUGmacro.tar.gz, and hyphen.tar.Z.
  1060.  
  1061.   The process of installation doesn't differ from too much the previous
  1062.   one.
  1063.  
  1064.   7.2.  The StarOffice suite
  1065.  
  1066.   Youri Kovalenko () has compiled a concise summary on StarOffice
  1067.   russification. It is located at .  I never had a chance to try it, so
  1068.   I cannot say anything about it's correctness.
  1069.  
  1070.   Another source of information on the subject is compiled by Eugene
  1071.   Demidov () and is located at
  1072.  
  1073.   8.  Printing and PostScript
  1074.  
  1075.   8.1.  Text to PostScript conversion
  1076.  
  1077.   Sometimes you have just a plain ASCII KOI8-R text and you want to
  1078.   print it just to get it on the paper. One of the easiest ways to
  1079.   achieve that is to use special programs converting text to PostScript.
  1080.  
  1081.   There are a number of programs doing such conversion. I personally
  1082.   prefer a2ps. Originally developed as a simple text-to-PostScript
  1083.   converter it became a big and highly configurable program with many
  1084.   options and allows you to manage various page layouts, syntax
  1085.   highlighting etc. Another tool (now available as a part of the GNU
  1086.   project) is enscript.
  1087.  
  1088.   8.1.1.  An a2ps converter
  1089.  
  1090.   A text to PostScript converter has been around for a while and is one
  1091.   of the most versatile printing tools. The author proved to be very
  1092.   open to suggestions, so since the release 4.9.8 a2ps supports Cyrillic
  1093.   right off-the-shelf. All you need is a PostScript printer.
  1094.  
  1095.   The command I use is:
  1096.  
  1097.   a2ps -X koi8r --print-anyway  <file>
  1098.  
  1099.   8.1.2.  The GNU enscript
  1100.  
  1101.   The GNU enscript program is also designed for converting text to
  1102.   PostScript and it also has a non-ASCII codeset support. It doesn't
  1103.   have Cyrillic PostScript fonts, but it is very easy to get them, as
  1104.   will be explained below (thanks to Michael Van Canneyt):
  1105.  
  1106.   1. Install the newest enscript. As of now, the most recent release is
  1107.      1.5. You may either get the one from the GNU FTP archive, or take
  1108.      an RPM package from the Redhat site.
  1109.  
  1110.   2. Now, if you are a lucky RedHat Linux user, download and install
  1111.      Cyrillic Textbook font
  1112.      <ftp://ftp.redhat.com/pub/contrib/i386/enscript-fonts-
  1113.      koi8-1.0-1.i386.rpm>.
  1114.  
  1115.   3. If you don't use RPM, download a file textbook.tar.gz from the
  1116.      Cyrillic Software collection on sunsite.unc.edu
  1117.      <ftp://sunsite.unc.edu/pub/academic/russian-studies/Software/>.
  1118.      Extract it to a directory, where enscript fonts are located
  1119.      (usually /usr/share/enscript). Now change to that directory and run
  1120.      the following command:
  1121.  
  1122.          mkafmmap *.afm
  1123.  
  1124.   4. The setup is finished. Try to print some text in KOI8-R Cyrillic
  1125.      with the following command:
  1126.  
  1127.          enscript --font=Textbook8 --encoding=koi8 some.file
  1128.  
  1129.   If you want a really quick and dirty solution and you don't care about
  1130.   the output quality and all you need is just Cyrillic on the paper, try
  1131.   the rtxt2ps package. It is a very simple no-frills text-to-PostScript
  1132.   conversion program. The output quality is not very good (or, to be
  1133.   honest, just bad) but it does it's job.
  1134.  
  1135.   8.2.  Text to TeX conversion
  1136.  
  1137.   If all you need is just to print an ASCII text without any additional
  1138.   word processing, you may try to use some programs, which would convert
  1139.   your Cyrillic text to a ready-to-process TeX file. One of the best
  1140.   programs for such purposes is translit (see section ``''). In this
  1141.   case, you don't even have to bother about installing the Cyrillic
  1142.   fonts for TeX, since translit uses a Washington Cyrillic package,
  1143.   which is included in most TeX distributions (or am I wrong?)
  1144.  
  1145.   9.  Cyrillic in PostScript
  1146.  
  1147.   Experts say PostScript is easy. I cannot judge - I've got too many
  1148.   things to learn to spare some time to learn PostScript. So I'll try to
  1149.   use my sad experience with it. I'll appreciate any feedback from you
  1150.   guys who know more on the subject than I do (approx. 99% of the Earth
  1151.   population).
  1152.  
  1153.   Basically, in order to print a Cyrillic text using PostScript, you
  1154.   have to make sure about the following things:
  1155.  
  1156.   ╖  Cyrillic font is loaded or included in the document.
  1157.  
  1158.   ╖  Cyrillic text is included in the document.
  1159.  
  1160.   ╖  Cyrillic text uses the appropriate character codes which correspond
  1161.      to the font's requirements.
  1162.  
  1163.   ╖  An appropriate font is selected in order to print Cyrillic text.
  1164.  
  1165.   There is no solution general enough to be recommended as an ultimate
  1166.   treatment. I'll try to outline various ways to cope with different
  1167.   problems related to the subject.
  1168.  
  1169.   One way to address Cyrillic setup problems generally enough is to use
  1170.   Ghostscript. Ghostscript (or just gs in the newspeak) is a free (well
  1171.   quasi-free) PostScript interpreter. It has many advantages; among
  1172.   them:
  1173.  
  1174.   ╖  Ability to run on many platforms (various Unices, Windows etc)
  1175.  
  1176.   ╖  Support for a wide number of non-PostScript printers
  1177.  
  1178.   ╖  Good degree of configurability
  1179.  
  1180.   What is important in our particular case, is that once Ghostscript is
  1181.   set up, we can do all printing through it, thus eliminating extra
  1182.   setup for other PostScript devices (for example HP LaserJet IV)
  1183.  
  1184.   9.1.  Adding Cyrillic fonts to Ghostscript
  1185.  
  1186.   This is important, since you probably don't want to put a
  1187.   responsibility to other programs to insert Cyrillic fonts in the
  1188.   PostScript output. Instead, you add them to gs and just make the
  1189.   programs generate Cyrillic output compatible with the fonts.
  1190.  
  1191.   To add a new font (in pfa or pfb form) in gs, you have to:
  1192.  
  1193.   1. Put it in the gs fonts directory (ie.  /usr/lib/ghostscript/fonts).
  1194.  
  1195.   2. Add the appropriate names and aliases for the font in the Fontmap
  1196.      file in the gs directory.
  1197.  
  1198.   Recently a decent set of Cyrillic fonts for GhostScript appeared.  It
  1199.   is located in ftp.kapella.gpi.ru. This one even has a necessary part
  1200.   to add to the Fontmap file. You have to download the contents of the
  1201.   /pub/cyrillic/psfonts directory. The README file describes the
  1202.   necessary details.
  1203.  
  1204.   10.  Print setup
  1205.  
  1206.   Printing is always tricky. There are different printers from different
  1207.   vendors with different facilities. Even for a native printing there is
  1208.   no uniform solution (this applies not only to UNIX, but to other
  1209.   operating systems as well.
  1210.  
  1211.   Printers have different control languages and often they have very
  1212.   different views on foreign language support.  The good news is that on
  1213.   control language seems to be recognized as a de-facto standard for
  1214.   print job description - it is a PostScript language developed by Adobe
  1215.   Corporation.
  1216.  
  1217.   Another problem is a variety of requirements to the print services.
  1218.   For example, sometimes you want just to print a piece if C program,
  1219.   containing comments in Russian, so you don't need any pretty-printing
  1220.   - just a raw ASCII output in a single font. Another time, when you
  1221.   design a postcard for your girlfriend, you'll probably need to typeset
  1222.   some document with different fonts etc. This will definitely require
  1223.   more effort to setup Cyrillic support.
  1224.  
  1225.   To accomplish the former task you just have to make your printer
  1226.   understand one Cyrillic font and (maybe) install some filter program
  1227.   to generate data in appropriate format. To accomplish the latter one,
  1228.   you have to teach your printer different fonts and have a special
  1229.   software.
  1230.  
  1231.   There is also something in the middle, when you get a program which
  1232.   knows how to generate both the fonts and the appropriate printer
  1233.   input, so you can say do some aource code pretty-printing without
  1234.   sophisticated word processing systems.
  1235.  
  1236.   All these options will be more or less covered below.
  1237.  
  1238.   10.1.  Pre-loading Cyrillic fonts into a non-PostScript printer
  1239.  
  1240.   If you have a good old dot matrix printer and all you need is to print
  1241.   a raw KOI8-R text, try the following:
  1242.  
  1243.   1. Find a proper KOI8-R font for your printer. Check out the MS-DOSish
  1244.      stuff on the Internet (for example the SimTel archive
  1245.      <ftp://ftp.simtel.net>).
  1246.  
  1247.   2. Learn from the manual, how to load such font into your printer and,
  1248.      probably, write a simple program doing that.
  1249.  
  1250.   3. Run this program from the appropriate rc file at a boot time.
  1251.  
  1252.   Thus, having Cyrillic characters in the upper part of the printer's
  1253.   character set will allow you to print you texts in Russian without any
  1254.   hussle.
  1255.  
  1256.   Alternatively to the KOI8-R fonts you may try to use the Alt font.
  1257.   There are two reasons for that:
  1258.  
  1259.   ╖  It may be probably much easier to find an Alt font, since those
  1260.      were very widespread in the MS-DOS culture.
  1261.  
  1262.   ╖  Having a proper Alt font will allow you to print pseudo-graphic
  1263.      characters as well.
  1264.  
  1265.   However in this case, you'll have to convert your texts from KOI8-R to
  1266.   Alt before sending them to a printer. This is quite easy, since there
  1267.   are a lot of programs doing that (see ``translit'' for example), so
  1268.   you just have to call such program properly in the if field in
  1269.   /etc/printcap file. For example, with the translit program you may
  1270.   specify:
  1271.  
  1272.   if=/usr/bin/translit -t koi8-alt.rus
  1273.  
  1274.   See printcap(5) for details.
  1275.  
  1276.   10.2.  Printing with different fonts
  1277.  
  1278.   One great way to cope with different printers and fonts is to use TeX
  1279.   (see section ``''). TeX drivers handle all details, so once you make
  1280.   TeX understand Cyrillic fonts, you are done.
  1281.  
  1282.   Another possibility is to use PostScript. I decided to devote an
  1283.   entire chapter ``'' to the subject, since it is not simple.
  1284.  
  1285.   Finally, there are other word processors, which have printer drivers.
  1286.   I never tried anything apart from TeX, so I cannot suggest anything.
  1287.  
  1288.   11.  Localization and Internationalization
  1289.  
  1290.   So far, I described how to make various programs understand Cyrillic
  1291.   text. Basically, each program required it's own method, very different
  1292.   from the others. Moreover, some programs had incomplete support of
  1293.   languages other than English. Not to mention their inability to
  1294.   interact using user's mother tongue instead of English.
  1295.  
  1296.   The problems outlined above are very pressing, since software is
  1297.   rarely developed for home market only. Therefore, rewriting
  1298.   substantial parts of software each time the new international market
  1299.   is approached is very ineffective; and making each program implement
  1300.   it's own proprietary solution for handling different languages is not
  1301.   a great idea in a long term either.
  1302.  
  1303.   Therefore, a need for standardization arises. And the standard shows
  1304.   up.
  1305.  
  1306.   Everything related to the problems above is divided by two basic
  1307.   concepts: localization and internationalization. By localization we
  1308.   mean making programs able to handle different language conventions for
  1309.   different countries. Let me give an example. The way date is printed
  1310.   in the United States is MM/DD/YY. In Russia however, the most popular
  1311.   format is DD.MM.YY. Another issues include time representation,
  1312.   printing numbers and currency representation format. Apart from it,
  1313.   one of the most important aspect of localization is defining the
  1314.   appropriate character classes, that is, defining which characters in
  1315.   the character set are language units (letters) and how they are
  1316.   ordered. On the other hand, localization doesn't deal with fonts.
  1317.  
  1318.   Internationalization (or i18n for brevity) is supposed to solve the
  1319.   problems related to the ability of the program interact with the user
  1320.   in his native language.
  1321.  
  1322.   Both of the concepts above had to be implemented in a standard, giving
  1323.   programmers a consistent way of making the programs aware of national
  1324.   environments.
  1325.  
  1326.   Althogh the standard hasn't been finished yet, many parts actually
  1327.   have; so they can be used without much of a problem.
  1328.  
  1329.   I am going to outline the general scheme of making the programs use
  1330.   the features above in a standard way. Since this deserves a separate
  1331.   document, I'll just try to give a very basic description and pointers
  1332.   to more thorough sources.
  1333.  
  1334.   11.1.  Locale
  1335.  
  1336.   One of the main concept of the localization is a locale. By locale is
  1337.   meant a set of conventions specific to a certain language in a certain
  1338.   country. It is usually wrong to say that locale is just country-
  1339.   specific. For example, in Canada two locales can be defined -
  1340.   Canada/English language and Canada/French language. Moreover,
  1341.   Canada/English is not equivalent to UK/English or US/English, just as
  1342.   Canada/French is not equivalent to France/French or
  1343.   Switzerland/French.
  1344.  
  1345.   11.1.1.  How to use locale
  1346.  
  1347.   Each locale is a special database, defining at least the following
  1348.   rules:
  1349.  
  1350.   1. character classification and conversion
  1351.  
  1352.   2. monetary values representation
  1353.  
  1354.   3. number representation (ie. the decimal character)
  1355.  
  1356.   4. date/time formatting
  1357.  
  1358.   In RedHat 4.1, which I am using there are actually two locale
  1359.   databases: one for the C library (libc) and one for the X libraries.
  1360.   In the ideal case there should be only one locale database for
  1361.   everything.
  1362.  
  1363.   To change your default locale, it is usually enough to set the LANG
  1364.   environment variable. For example, in sh:
  1365.  
  1366.   LANG=ru_RU
  1367.   export LANG
  1368.  
  1369.   Sometimes, you may want to change only one aspect of the locale
  1370.   without affecting the others. For example, you may decide (God knows
  1371.   why) to stick with ru_RU locale, but print numbers according to the
  1372.   standard POSIX one. For such cases, there is a set of environment
  1373.   variables, which you can you to configure specific parts for the
  1374.   current locale. In the last exaple it would be:
  1375.  
  1376.   LANG=ru_RU
  1377.   LC_NUMERIC=POSIX
  1378.   export LANG LC_NUMERIC
  1379.  
  1380.   For the full description of those variables, see locale(7).
  1381.  
  1382.   Now let's be more Linux-specific. Unfortunately, Linux libc version
  1383.   5.3.12, supplied with RedHat 4.1, doesn't have a russian locale. In
  1384.   this case one must be downloaded from the Internet (I don't know the
  1385.   exact address, however).
  1386.  
  1387.   To check, locale for which languages you have, run 'locale -a'. It
  1388.   will list all locale databases, available to libc.
  1389.  
  1390.   Fortunately, Linux community is rapidly moving to the new GNU libc
  1391.   (glibc version 2, which is much more POSIX-compliant and has a proper
  1392.   russian locale. Next "stable" RedHat system will already use glibc.
  1393.  
  1394.   As for the X libraries, they have their own locale database. In the
  1395.   version I am using (XFree86 3.3), there already is a russian locale
  1396.   database. I am not sure about the previous versions. In any case, you
  1397.   may check it by looking into usr/lib/X11/locale/ (on most systems). In
  1398.   my case, there already are subdirectories named koi8-r and even
  1399.   iso8859-5.
  1400.  
  1401.   11.1.2.  Locale-aware programming
  1402.  
  1403.   With locale, program don't have to implement explicitly various
  1404.   character conversion and comparison rules, described above. Instead,
  1405.   they use special API which make use of the rules defined by locale.
  1406.   Also, it is not necessary for program to use the same locale for all
  1407.   rules - it is possible to handle different rules using different
  1408.   locales (although such technique should be strongly discouraged).
  1409.  
  1410.   From the setlocale(3) manual page:
  1411.  
  1412.        A  program  may be made portable to all locales by calling
  1413.        setlocale(LC_ALL, "" ) after program   initialization,  by
  1414.        using  the  values  returned  from a localeconv() call for
  1415.        locale - dependent information and by using  strcoll()  or
  1416.        strxfrm() to compare strings.
  1417.  
  1418.   SunSoft, for example, defines 5 levels of program localization:
  1419.  
  1420.   1. 8-bit clean software. That is, the program calls setlocale(), it
  1421.      doesn't make any assumptions about the 8th bit of each character,
  1422.      it users functions from ctype.h and limits from limits.h, and it
  1423.      takes care about signed/unsigned issues.
  1424.  
  1425.      It is very important not to do any assumption about the character
  1426.      set nature and ordering. The following programming practices must
  1427.      be avoided:
  1428.  
  1429.          if (c >= 'A' && c <= 'Z') {
  1430.              ...
  1431.  
  1432.   Instead, macros from the ctype.h header file are locale-aware and
  1433.   should be used in all such occasions.
  1434.  
  1435.   2. Formats, sorting methods, paper sizes. The program uses strcoll()
  1436.      and strxfrm() instead of strcmp() for strings, it uses time(),
  1437.      localtime(), and strftime()/ for time services, and finally, it
  1438.      uses localeconv() for a proper numbers and currency representation.
  1439.  
  1440.   3. Visible text in message catalogs. The program must isolate all
  1441.      visible text in special message catalogs. Those map strings in
  1442.      English to their translation to other languages. Selection of
  1443.      messages in an appropriate for a particular environment language is
  1444.      done in a way which is completely transparent for both the program
  1445.      and it's user. To make use of those facilities, the program must
  1446.      call gettext() (Sun/POSIX standard), or catgets() (X/Open
  1447.      standard). For more information on that see section ``''.
  1448.  
  1449.   4. EUC/Unicode support. At this level, the program doesn't use the
  1450.      char type. Instead it uses wchar_t, which defines entities big
  1451.      enough to contain Unicode characters. ANSI C defines this data type
  1452.      and an appropriate API.
  1453.  
  1454.   For a more detaled explanation of locale, see, for example (``'') or
  1455.   (``'').
  1456.  
  1457.   11.2.  Internationalization
  1458.  
  1459.   While localization describes, how to adapt a program to a foreign
  1460.   environment, internationalization (or i18n for brevity) details the
  1461.   ways to make program communicate with a non-English speaking user.
  1462.  
  1463.   Before, that was done by developing some abstraction of the messages
  1464.   to output from the program's code. Now, such mechanism is (more or
  1465.   less) standardized. And, of course, there are free implementations of
  1466.   it!
  1467.  
  1468.   The GNU project has finally adopted the way of making the
  1469.   internationalized applications. Ulrich Drepper (drepper@ipd.info.uni-
  1470.   karlsruhe.de) developed a package gettext. This package is available
  1471.   at all GNU sites like prep.ai.mit.edu. It allows you to develop
  1472.   programs in the way that you can easily make them support more
  1473.   languages. I don't intend to describe the programming techniques,
  1474.   especially because the gettext package is delivered with excellent
  1475.   manual.
  1476.  
  1477.   Request for collaboration: If you want to learn the gettext package
  1478.   and to contribute to the GNU project simultaneously; or even if you
  1479.   just want to contribute, then you can do it! GNU goes international,
  1480.   so all the utilities are being made locale-aware. The problem is to
  1481.   translate the messages from English to Russian (and other languages if
  1482.   you'd like). Basically, what one has to do is to get the special .po
  1483.   file consisting of the English messages for a certain utility and to
  1484.   append each message with it's equivalent in Russian. Ultimately, this
  1485.   will make the system speak Russian if the user wants it to! For more
  1486.   details and further directions contact Ulrich Drepper
  1487.   (drepper@ipd.info.uni-karlsruhe.de).
  1488.  
  1489.   12.  Staying compatible
  1490.  
  1491.   Being standard is not the only issue. To be really nice, one has to
  1492.   provide the backward compatibility. In our case, this means that the
  1493.   configuration should be tolerant to the data created using non-
  1494.   standard character sets - that is the Alt (cp866) and cp1251 ones.
  1495.   Also, we should be able to run Cyrillic programs for MS-DOS.
  1496.  
  1497.   In most cases (except for HTTP), it is enough to provide a timely
  1498.   conversion of data to KOI8-R. When we talk about raw unstructured
  1499.   data, it is quite trivial - see section ``Conversion Utilities''.
  1500.  
  1501.   Another issue is the structured data. This case is more tricky. I'll
  1502.   try to outline the basic roadmap of fixing it.
  1503.  
  1504.   12.1.  MIME-based data compatibility
  1505.  
  1506.   MIME is a standard for architecture-independent data representation.
  1507.   Originally developed for mail messages, it has now many more
  1508.   applications. MIME defines format, which is open to extensions and
  1509.   allows architecture-specific handling of data. For example, if I
  1510.   receive a mail message, containing a MIME object of the video/mpeg
  1511.   type (an encoded MPEG file), my mail reader will automatically decode
  1512.   it and start an MPEG player.
  1513.  
  1514.   Most UNIX programs, offering MIME capabilities, are based on the
  1515.   metamail package, which contains a set of utilities and data files to
  1516.   work with MIME objects. Several configuration files (/etc/mailcap for
  1517.   global usage and ~/.mailcap for personal setup) define rules for
  1518.   handling MIME object of various types.
  1519.  
  1520.   Thus, if you receive a proper MIME data stream, containing text in one
  1521.   of the obsolete character sets, you may define a MIME rule to convert
  1522.   such text to KOI8.
  1523.  
  1524.   Below a number of MIME rules are shown, which are supposed to handle
  1525.   plain text and richtext objects, using both of the obsolete codesets,
  1526.   discussed above. You may incorporate these rules into one of the MIME
  1527.   configuration files.
  1528.  
  1529.   Note, that these rules use the translit package to perform the actual
  1530.   conversion. For more information on that program and the conversion in
  1531.   general see section ``Conversion Utilities''.
  1532.  
  1533.   text/plain; translit -t cp1251-koi8.rus < %s; test=test \
  1534.       "`echo %{charset} | tr '[A-Z]' '[a-z]'`"  = cp1251; copiousoutput
  1535.  
  1536.   text/richtext; translit -t cp1251-koi8.rus < %s; test=test \
  1537.       "`echo %{charset} | tr '[A-Z]' '[a-z]'`"  = cp1251; copiousoutput
  1538.  
  1539.   text/plain; translit -t alt-koi8.rus < %s; test=test \
  1540.       "`echo %{charset} | tr '[A-Z]' '[a-z]'`"  = cp866; copiousoutput
  1541.  
  1542.   text/richtext; translit -t alt-koi8.rus < %s; test=test \
  1543.       "`echo %{charset} | tr '[A-Z]' '[a-z]'`"  = cp866; copiousoutput
  1544.  
  1545.   text/plain; translit -t alt-koi8.rus < %s; test=test \
  1546.       "`echo %{charset} | tr '[A-Z]' '[a-z]'`"  = alt; copiousoutput
  1547.  
  1548.   text/richtext; translit -t alt-koi8.rus < %s; test=test \
  1549.       "`echo %{charset} | tr '[A-Z]' '[a-z]'`"  = alt; copiousoutput
  1550.  
  1551.   Obviously enough, this will work for plain text data only. Binary
  1552.   files are supposed to handle the codeset issues themselves (at least
  1553.   their "parent" applications are). Therefore, if you receive a
  1554.   Microsoft Word document in the cp1251 character set, the duty of
  1555.   providing appropriate conversion capabilities lays upon an application
  1556.   you use to read that document (for example Microsoft Word, or Applix
  1557.   Words).
  1558.  
  1559.   Unfortunately, the real situation is not that ideal. Many application
  1560.   have their own idea on how to use MIME. Until recently Microsoft Mail
  1561.   software had a broken MIME engine. Also, the Netscape
  1562.   Navigator/Communicator mail client is notorious because of it's
  1563.   sending of mail messages, encoded in cp1251 with the charset=koi8-r
  1564.   field in the message header and vice versa.
  1565.  
  1566.   12.2.  Explicit character set conversion
  1567.  
  1568.   There are a lot of conversion routines for Cyrillic on the Internet.
  1569.   Each of them has it's own quirks and it's own degree of Cyrillic
  1570.   support.
  1571.  
  1572.   In my opinion tools must be standard. In this particular case the
  1573.   "standard" conversion tool is GNU recode. Unfortunately, the version,
  1574.   found on the official GNU site (3.4) doesn't support Cyrillic yet
  1575.   (only ISO-8859-5). I developed a set of conversion tables for KOI8-R,
  1576.   Alt, and cp1251 for recode and submitted them to the recode
  1577.   maintainer. He promised to provide Cyrillic support in the upcoming
  1578.   release. Once it happens, I'll rewrite this section to recommend GNU
  1579.   recode as the standard conversion engine for Cyrillic.
  1580.  
  1581.   Meanwhile, I would recommend a translit package. It supports many
  1582.   popular codesets and is even able to produce a *TeX files (see section
  1583.   ``'') from text in Russian. Also, RedHat users will enjoy an RPM
  1584.   package for translit.
  1585.  
  1586.   For other conversion routines, Look at SovInformBureau or
  1587.   ftp.funet.fi. You can even use the special mode for emacs (see section
  1588.   ``Emacs'').
  1589.  
  1590.   12.3.  Cyrillic in the DOS emulator
  1591.  
  1592.   This seems to be the only application, which may require Alt Cyrillic
  1593.   character set. The reason is that Alt is native to DOS and most of DOS
  1594.   programs dealing with Cyrillic are Alt-oriented.
  1595.  
  1596.   For the console version (dos) you just have to load a keyboard and
  1597.   screen driver. Most of DOS drivers will work fine. I personally use
  1598.   the rk driver by A. Strakhov, which works for both console and X
  1599.   versions of dosemu. Another choice is the r driver by V. Kurland
  1600.   (sorry for possible misspelling). It is perfectly customizable and
  1601.   supports many codesets, Alt and KOI8 among them. However it won't work
  1602.   for the X window (at least version 1.14 I'm using).
  1603.  
  1604.   Both drivers can be found on most Russian Internet sites, for example
  1605.   Kurchatov Institute FTP server <ftp://ftp.kiae.su/pub/cyrillic/msdos>.
  1606.  
  1607.   For the X version of dosemu you have to provide an appropriate X font
  1608.   as well. Alex Bogdanov sent me such font by e-mail. It is an original
  1609.   vga font from the dosemu distribution, modified for the Alt codeset.
  1610.   Unfortunately I don't know who is the creator of this font and where
  1611.   the official site is.
  1612.  
  1613.   To setup the font for dosemu you should
  1614.  
  1615.   ╖  Introduce this font to the X. This is described in ``X fonts
  1616.      setup''.
  1617.  
  1618.   ╖  Introduce this font to dosemu. If the font just replaces the
  1619.      original vga font, then it will be recognized by default.
  1620.      Otherwise, you have to describe it in /etc/dosemu.conf:
  1621.  
  1622.      # Font to use (without filename extensions). For example:
  1623.      X { updatefreq 8 title "MS DOS" icon_name "xdos" font "vga-alt"}
  1624.  
  1625.   Finally, you have to load a keyboard driver. Note, the you don't need
  1626.   a screen driver for the X window. Therefore, not all drivers will
  1627.   work. At least two will: rk by A. Strakhov, and cyrkeyb by Pete
  1628.   Kvitek.
  1629.  
  1630.   13.  Bibliography
  1631.  
  1632.   1. Andrey Chernov. KOI-8 <http://www.nagual.ru/~ache/koi8.html>. KOI-8
  1633.      information and setup.
  1634.  
  1635.   2. Ulrich Drepper. Internationalization in the GNU project
  1636.      <http://i44www.info.uni-karlsruhe.de/~drepper/conf96/paper.html>.
  1637.      Very thorough description of a GNU approach to i18n.
  1638.  
  1639.   3. Michael Karl Gschwind. Internationalization
  1640.      <http://www.vlsivie.tuwien.ac.at/mike/i18n.html>. Various resources
  1641.      on i18n.
  1642.  
  1643.   4. Sergei Naumov. Information on Cyrillic Software
  1644.      <http://sunsite.oit.unc.edu/sergei/Software/Software.html>.
  1645.      Cyrillic setup information.
  1646.  
  1647.   5. The Open Group Single UNIX specification <http://www.UNIX-
  1648.      systems.org/online.html>.
  1649.  
  1650.   6. RFC 1489 RFC 1489 <file://ds.internic.net/rfc/rfc1489.txt>
  1651.  
  1652.   7. Alec Voropay. Localization as it is
  1653.      <http://www.sensi.org/~alec/locale>. General locale usage in
  1654.      Russian.
  1655.  
  1656.   14.  Summary of the various useful resources
  1657.  
  1658.   a2ps homepage <http://www-inf.enst.fr/~demaille/a2ps.html>
  1659.  
  1660.   General Linux Information <http://www.linux.org>
  1661.  
  1662.   Collection of Cyrillic resources
  1663.   <ftp://ftp.ccl.net/pub/central_eastern_europe/russian>
  1664.  
  1665.   Cyrillic resources at KIAE <ftp://ftp.kiae.su/cyrillic/>
  1666.  
  1667.   Cyrillic resources at RELCOM <ftp://ftp.relcom.ru/cyrillic/>
  1668.  
  1669.   Cyrillic resources at FUNET
  1670.   <ftp://ftp.funet.fi/pub/culture/russian/comp/>
  1671.  
  1672.   Cronyx <http://www.cronyx.ru> - the creators of Cyrillic fonts for the
  1673.   X Window System.
  1674.  
  1675.   Cyrillic fonts for Ghostscript and StarOffice
  1676.   <ftp://ftp.kapella.gpi.ru/pub/cyrillic/psfonts>
  1677.  
  1678.   Cyrillic fonts for X
  1679.   <ftp://ftp.kiae.su/cyrillic/x11/fonts/xrus-2.1.1-src.tgz>
  1680.  
  1681.   Ghostscript <http://www.cs.wisc.edu/~ghost/index.html>
  1682.  
  1683.   GNU enscript <ftp://prep.ai.mit.edu/pub/gnu>
  1684.  
  1685.   relcom.fido.ru.linux newsgoup.
  1686.  
  1687.   relcom.fido.ru.unix newsgoup.
  1688.  
  1689.   Russian dictionary for GNU ispell <http://www.ispras.ru/~knizhnik>
  1690.  
  1691.   SovInformBureau <http://www.siber.com/sib/russify/>
  1692.  
  1693.   teTeX russification package <ftp://xray.sai.msu.su/pub/outgoing/teTeX-
  1694.   rus/>
  1695.  
  1696.   The kbd package for Linux
  1697.   <ftp://sunsite.unc.edu/pub/Linux/system/Keyboards/>
  1698.  
  1699.   The remap package for Emacs <ftp://ftp.iesd.auc.dk/>
  1700.  
  1701.   The rtxt2ps package <http://www.siber.com/sib/russify/converters/>
  1702.  
  1703.   The russian.el package for emacs
  1704.   <http://www.math.uga.edu/~valery/russian.el>
  1705.  
  1706.   The translit package
  1707.   <ftp://ftp.osc.edu/pub/russian/translit/translit.tar.Z>
  1708.  
  1709.   The xruskb package <ftp://ftp.relcom.ru/pub/x11/cyrillic/>
  1710.  
  1711.   Useful Cyrillic packages <ftp://sunsite.unc.edu/pub/academic/russian-
  1712.   studies/Software>
  1713.  
  1714.   X fonts collections <ftp://ftp.switch.ch/mirror/linux/X11/fonts/>
  1715.  
  1716.   XFree86 FTP site <http://www.xfree86.org>
  1717.  
  1718.